package com.erp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.erp.common.R;
import com.erp.dto.UserDto;
import com.erp.entity.vo.ViewAction;
import com.erp.entity.vo.ViewManager;
import com.erp.entity.User;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Map;

public interface UserService extends IService<User> {

    //用户注册
    R<UserDto> register(Map<String, String> map, HttpSession httpSession);

    //通过username查询用户角色权限
    ViewManager findManagerByUsername(String username);

    //根据角色名称查询操作权限
    List<ViewAction> findActionByManagerId(String managerName);

    //根据username查询用户
    User findByUsername(String username);

    //新增用户并赋予默认权限
    R<String> add(User user);

    //删除用户并删除权限
    R<String> delete(Long id);

    //对象复制
    UserDto userDtoCopy(User user);

}
